package com.edu.service.imlp;

import com.edu.dao.RentalsDao;
import com.edu.dao.impl.RentalsDaoImpl;
import com.edu.entity.Rentals;
import com.edu.service.RentalsService;

import java.util.List;

public class RentalsServiceImpl implements RentalsService {
    RentalsDao rentalsDao = new RentalsDaoImpl();

    @Override
    public List<Rentals> queryRentals(int uid) {
        return rentalsDao.getUidRentals(uid);
    }

    @Override
    public boolean addRental(int uId, int vId, int duration, double totalCost) {
        return rentalsDao.addRental(uId, vId, duration, totalCost) == 1 ? true : false;
    }
}
